home *** CD-ROM | disk | FTP | other *** search
- // NeuroSolutions v4.2
-
- // Copyright (c) 1994, NeuroDimension, Inc. All rights reserved.
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __GLOBAL_H__
- #define __GLOBAL_H__
-
- #define PC
- #define MS_VISUAL
-
- #include <stdio.h>
- #include <float.h>
- #include <string.h>
- #include <stdlib.h>
- #include <time.h>
- #include <math.h>
- #include <ctype.h>
-
- #define WEIGHTFILEVERSION 225
- #define nil NULL
- #define YES 1
- #define NO 0
- #define MAX(x,y) x>y?x:y;
- #define MIN(x,y) x<y?x:y;
- #define PI 3.1415927
- #define NSInt int
- #define NSUInt UINT
- #define NSLong long
- #define NSFloat float
-
- #define NSSEEK_CUR 1
- #define NSSEEK_END 2
- #define NSSEEK_SET 0
-
- #ifndef PC
- #define SWAP
- #endif
-
- #ifdef MS_VISUAL
- #define finite _finite
- #else
- #define finite(x) ((x>-1.0e12) && (x<1.0e12))
- #endif
-
- #define DLL_PARAM_ROWS 5
- #define DLL_PARAM_COLS 3
-
- #ifndef FALSE
- #define FALSE 0
- #endif
- #ifndef TRUE
- #define TRUE 1
- #endif
- #ifndef NULL
- #define NULL 0
- #endif
-
- //#ifdef _DEBUG
- // #define malloc \
- // NSMalloc
- // #define calloc \
- // NSCalloc
- // #define free \
- // NSFreeMemory
- //#endif
-
- #ifndef NS_GUI
- typedef int BOOL;
- #endif
-
- typedef struct {
- NSFloat *data;
- int length;
- } DLLWeights;
-
- typedef struct {
- char parameters[DLL_PARAM_ROWS][DLL_PARAM_COLS][64];
- char parameterNames[DLL_PARAM_ROWS][DLL_PARAM_COLS][64];
- BOOL parameterReallocs[DLL_PARAM_ROWS][DLL_PARAM_COLS];
- } DLLParameters;
-
- typedef struct {
- DLLWeights *weights;
- DLLParameters *parameters;
- void *userData;
- } DLLData;
-
- typedef struct {
- void *function,
- *constructor,
- *destructor;
- DLLData *instance;
- } DLLStruct;
-
- typedef DLLData *(*DLL_Constructor)(DLLData *);
- typedef DLLData *(*DLL_Constructor_CSW)(DLLData *, void *);
- typedef void (*DLL_Destructor)(DLLData *);
- typedef void (*DLL_Destructor_CSW)(DLLData *, void *);
-
- //void* NSMalloc(size_t);
- //void* NSCalloc(size_t, size_t);
- //void NSFreeMemory(void*);
- //UINT NSBytesAllocated();
- unsigned short int getWeightFileVersion(FILE *file);
- FILE *seekComponent(FILE *, const char *, const char *);
- FILE *seekComponentReturnNull(FILE *, const char *, const char *);
- FILE *putComponent(FILE *, const char *, const char *);
- void writeWeightFileVersion(FILE *);
-
- #endif __GLOBAL_H__
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __NSDLL_H__
- #define __NSDLL_H__
-
- void checkParameterIndices(int *row,int *col);
- DLLData *allocDLLInstance(DLLData *oldInstance);
- void freeDLLInstance(DLLData *instance);
- DLLData *setWeights(DLLData *instance, int numberOfWeights);
- DLLData *allocParameters(DLLData *instance);
- NSFloat *getWeights(DLLData *instance);
- void setUserData(DLLData *instance, void *userData);
- void *getUserData(DLLData *instance);
- void setParameterName(DLLData *instance, int row, int col, char *name, BOOL realloc);
- int getIntParameter(DLLData *instance, int row, int col);
- NSFloat getFloatParameter(DLLData *instance, int row, int col);
- char *getStringParameter(DLLData *instance, int row, int col);
- BOOL getBoolParameter(DLLData *instance, int row, int col);
- void setIntParameter(DLLData *instance, int row, int col, int intValue, BOOL force);
- void setFloatParameter(DLLData *instance, int row, int col, NSFloat floatValue, BOOL force);
- void setStringParameter(DLLData *instance, int row, int col, char *stringValue, BOOL force);
- void setBoolParameter(DLLData *instance, int row, int col, BOOL boolValue, BOOL force);
-
- #endif __NSDLL_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SpatialAccess_H__
- #define __SpatialAccess_H__
-
-
- class SpatialAccess
- {
- protected:
- SpatialAccess *stackedAccess;
- BOOL m_bTesting, m_bAccessTesting;
- public:
- static BOOL m_bRefreshAccess;
- NSFloat *data;
- int rowCount, colCount, spatialCount;
- SpatialAccess();
- BOOL accessTesting() { return m_bAccessTesting; };
- void attachTo(SpatialAccess *);
- int cols() { return colCount; };
- virtual void reportSpatialAccess();
- virtual void reportSpatialAccess(NSFloat *);
- virtual void reportSpatialData();
- int S() { return spatialCount; };
- NSFloat &S(int i) { return *(data + i); };
- NSFloat &S(int i, int j) { return *(data + j + i*cols()); };
- int rows() { return rowCount; };
- void setAccessTesting(BOOL aBOOL) { m_bAccessTesting = aBOOL; };
- virtual void setData(NSFloat *, int, int=1);
- virtual void setStackedAccess(SpatialAccess *);
- void setTesting(BOOL aFlag) { m_bTesting = aFlag; };
- BOOL testing() { return m_bTesting; };
- virtual ~SpatialAccess();
- };
-
- #endif // __SpatialAccess_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SpatialData_H__
- #define __SpatialData_H__
-
-
- class SpatialData: public SpatialAccess
- {
- protected:
- NSFloat *allocatedData,
- randomRange;
- public:
- BOOL m_bAccessEnabled;
-
- public:
- SpatialData();
- void assignScalar(NSFloat);
- void copyDataFrom(NSFloat *);
- void copyDataFromDouble(NSFloat *);
- void copyDataTo(NSFloat *);
- virtual void deleteData();
- virtual void oversizeSpatialDimension(int);
- void randomize();
- virtual void setSpatialDimension(int, int=1);
- void zero();
- ~SpatialData();
- };
-
- #endif // __SpatialData_H__
-
-
- #ifndef __InputSpatialData_h__
- #define __InputSpatialData_h__
-
- class InputSpatialData: public SpatialData
- {
- protected:
- BOOL m_bPerformNormalization;
- int m_iAllocatedChannels;
- NSFloat *m_fDenormalizedData;
- public:
- NSFloat *m_fAmplitude,
- *m_fOffset;
- public:
- InputSpatialData();
- ~InputSpatialData();
- // NSFloat &litude(int i) { return *(m_fAmplitude+i); };
- void denormalizeData();
- void loadWeights(FILE *file, unsigned short int version);
- void normalizeData();
- // NSFloat &offset(int i) { return *(m_fOffset+i); };
- void saveWeights(FILE *file);
- void setPerformNormalization(BOOL aBool) { m_bPerformNormalization = aBool; };
- void setSpatialDimension(int rowInt, int colInt);
- };
-
- #endif // __InputSpatialData_h__
-
- // File.h
- // by David Scott Samson
-
- #ifndef __File_h__
- #define __File_h__
-
-
- enum MODE {ASCII = 0, BINARY, STANDARD };
- enum RW {WRITE = 0, READ };
-
- class File: public InputSpatialData
- {
- protected:
- FILE *m_pFileStream;
- char m_sFilePath[1024];
- MODE m_iMode;
- RW m_readWrite;
- BOOL m_AdvanceStream,
- m_StreamConstant,
- m_FixStream;
- int m_iDitherInput;
- NSFloat m_fDither;
- public:
- File();
- File(char *, RW=READ, MODE=BINARY);
- ~File();
- void advanceStream();
- BOOL closeFile();
- void ditherInput(int, NSFloat aFloat=0.1f);
- char *filePath(){return m_sFilePath;};
- void fixStream(BOOL);
- int mode() {return m_iMode;};
- BOOL openFile();
- void reportSpatialData();
- void setMode(RW, MODE);
- void setFilePath(char *);
- };
-
- #endif // __File_h__
-
- #ifndef __DLLInput_H__
- #define __DLLInput_H__
-
-
- typedef DLLData *(*DLLInput_Constructor)(DLLData *, int, int);
- typedef DLLData *(*DLLInput_Constructor_CSW)(DLLData *, int, int, void *);
- typedef void (*DLLInput_MAP)(DLLData *, NSFloat *, int, int);
- typedef void (*DLLInput_MAP_CSW)(DLLData *, NSFloat *, int, int, void *);
-
- class DLLInput : public InputSpatialData
- {
- protected:
- DLLStruct *dllStruct;
- void *m_pCallingObject;
- public:
- DLLInput();
- void reportSpatialData();
- virtual void constructDLL();
- virtual void destroyDLL(DLLData *);
- virtual void initializeDLL();
- void setData(NSFloat *, int, int);
- void setDLL(void *function, void *constructor=NULL, void *destructor=NULL, void *instance=NULL, void *callingObject=NULL);
- void setSpatialDimension(int, int);
- };
-
- #endif __DLLInput_H__
-
- #ifndef __DLLPreprocessor_H__
- #define __DLLPreprocessor_H__
-
-
- typedef DLLData *(*DLLPreprocessor_Constructor)(DLLData *, int*, int*, BOOL);
- typedef DLLData *(*DLLPreprocessor_Constructor_CSW)(DLLData *, int*, int*, BOOL, void *);
- typedef BOOL (*DLLPreprocessor_MAP)(DLLData *, NSFloat *, NSFloat *, int, int, BOOL);
- typedef BOOL (*DLLPreprocessor_MAP_CSW)(DLLData *, NSFloat *, NSFloat *, int, int, BOOL, void *);
-
- class DLLPreprocessor : public DLLInput
- {
- protected:
- class SpatialData *m_pData;
- BOOL m_bInputDataLocal;
- public:
- DLLPreprocessor();
- ~DLLPreprocessor();
- void constructDLL();
- virtual BOOL isPreprocessor();
- void reportSpatialData();
- void setInputData(SpatialData *);
- };
-
- #endif __DLLPreprocessor_H__
-
- #ifndef __DLLPostprocessor_H__
- #define __DLLPostprocessor_H__
-
-
- class DLLPostprocessor : public DLLPreprocessor
- {
- public:
- DLLPostprocessor();
- BOOL isPreprocessor();
- void reportSpatialData();
- };
-
- #endif __DLLPostprocessor_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __Soma_H__
- #define __Soma_H__
-
-
- class Soma {
- friend class Axon;
- friend class Synapse;
- friend class BackAxon;
- friend class BackSynapse;
- int cells;
- protected:
- NSFloat *cell, *t, *T, *link, *bufPosition;
- int inputCells, outputCells, links, dllLinks;
- NSFloat m_fWeightVariance, m_fWeightMean;
- int somaTemporalDimension;
- BOOL m_bWeightsFixed, m_bFreeCell, m_bWeightsLocallyAllocated;
- void *m_pCallingObject;
- public:
- Soma *Next;
- SpatialAccess *activityAccess, *linkAccess, *dllLinkAccess;
- DLLStruct *dllStruct;
- Soma();
- virtual ~Soma(void);
- virtual void epochEnded();
- virtual void loadWeights(FILE *, unsigned short int version=100);
- virtual void loadStateVariables(FILE *file, unsigned short int version);
- virtual void saveWeights(FILE *, BOOL addLineFeed=TRUE);
- virtual void saveStateVariables(FILE *file);
- // DLL Stuff
- virtual const char *dllFunctionName();
- virtual void constructDLL(void);
- virtual void destroyDLL(DLLData *);
- virtual void initializeDLL(void);
- virtual void setDLLFunction(DLLStruct *);
- virtual void setDLL(void *function, void *constructor=NULL, void *destructor=NULL, void *instance=NULL, void *callingObject=NULL);
- //
- NSFloat weightMean(void) { return m_fWeightMean;} ;
- NSFloat weightVariance(void) { return m_fWeightVariance;} ;
- BOOL weightsFixed(void) { return m_bWeightsFixed;} ;
- void setWeightMean(NSFloat);
- void setWeightVariance(NSFloat);
- void setWeightsFixed(BOOL aBOOL) { m_bWeightsFixed = aBOOL; };
- virtual void rangeLinks(void);
- virtual void zeroState(void) {};
- virtual void networkReset(void);
- virtual BOOL isAnAxon(void) { return FALSE; };
- virtual BOOL isASynapse(void) { return FALSE; };
- virtual void storeBufPosition(void);
- virtual void recallBufPosition(void);
- virtual void allocateLinks(int _links, BOOL force=FALSE);
- void assignLinks(NSFloat *newLink, BOOL freeLater=TRUE);
- void attachTo(Soma *aSoma, int delay);
- void decrement(void) { if ((t -= cells) < cell) t = T - cells; };
- virtual void decrementTime(void);
- void deleteLinks(void);
- virtual void fire(void);
- virtual void fireDummy(void);
- void increment(void) { if ((t += cells) >= T) t = cell; };
- virtual void incrementTime(void);
- virtual void networkJog(void);
- virtual void networkRandomize(void);
- virtual void activityAltered(void);
- virtual void linksAltered(void);
- virtual void setInputCells(int numberOfCells);
- void setActivityAccess(SpatialAccess *);
- void setLinkAccess(SpatialAccess *);
- void setDLLLinkAccess(SpatialAccess *);
- virtual void removeLast(Soma *) {};
- virtual void removeNext(Soma *) {};
- virtual void setLast(Soma *) {};
- virtual void setNext(Soma *) {};
- virtual void setOutputCells(int numberOfCells);
- virtual void setTemporalDimension(int T);
- int temporalDimension(void) { return somaTemporalDimension; };
- int U(void) {return inputCells;};
- int V(void) {return outputCells;};
- NSFloat &V(int i) {return *(t+i);};
- NSFloat &w(int i) {return *(link+i);};
- int w(void) {return links;};
- int W(void) {return links+dllLinks;};
- BOOL weightsLocallyAllocated() { return m_bWeightsLocallyAllocated; };
- NSFloat *weightVector() { return link; };
- };
-
- #endif // __Soma_H__
-
- // Author: Wesley Curtis Lefebvre
- // Name: Axon.h
-
- #ifndef __Axon_H__
- #define __Axon_H__
-
-
- typedef void (*Axon_MAP)(DLLData *, NSFloat *, int, int);
- typedef void (*Axon_MAP_CSW)(DLLData *, NSFloat *, int, int, void *);
- typedef DLLData *(*Axon_Constructor)(DLLData *, int, int);
- typedef DLLData *(*Axon_Constructor_CSW)(DLLData *, int, int, void *);
-
- class Axon: public Soma {
- protected:
- int m_iRows, m_iCols;
- int dummyFiredCounter, firedCounter, lastCount, m_iInputNeurons;
- Soma *forcedLast;
- BOOL m_bFireNext, m_bFireNextOnReset, m_bFirePending;
- NSFloat *m_pIPInputBuffer;
- public:
- int nextCount;
- Soma *nextConnection[128];
- public:
- SpatialAccess *preActivityAccess;
- Axon();
- void activityAltered(void);
- void loadWeights(FILE *, unsigned short int version=100);
- void saveWeights(FILE *, BOOL addLineFeed=TRUE);
- int cols() { return m_iCols; };
- void constructDLL(void);
- void fire(void);
- void fireDummy(void);
- const char *dllFunctionName();
- virtual void fireDLL(void);
- virtual void fireFeed(void);
- virtual void fireMap(void);
- BOOL fireNext(void) { return m_bFireNext; };
- void incrementTime(void);
- virtual void initialize(void);
- BOOL isAnAxon(void) { return TRUE; };
- virtual void networkReset();
- void removeForcedLast(Soma *) { forcedLast=NULL; };
- void removeLast(Soma *aSoma);
- void removeNext(Soma *aSoma);
- int rows() { return m_iRows; };
- void setCols(int);
- void setDLLFunction(DLLStruct *);
- void setFireNext(BOOL aBOOL) { m_bFireNext = aBOOL; };
- void setFireNextOnReset(BOOL aBOOL) { m_bFireNextOnReset = aBOOL; };
- void setForcedLast(Soma *aSoma) { forcedLast=aSoma; };
- void setInputCells(int numberOfCells);
- void setIPInputBuffer(NSFloat *aBuffer) { m_pIPInputBuffer = aBuffer; };
- void setLast(Soma *aSoma);
- void setNext(Soma *nextSoma);
- void setOutputCells(int numberOfCells);
- void setPreActivityAccess(SpatialAccess *);
- void setRows(int);
- void setTemporalDimension(int T);
- // NSFloat &V(int i, int j) { return V(j + i*m_iCols); };
- ~Axon(void);
- };
-
- #endif // __Axon_H__
- /*
- #ifndef __ExpanderAxon_H__
- #define __ExpanderAxon_H__
-
- class ExpanderAxon: public Axon {
- protected:
- int m_nExpansionFactor;
- public:
- ExpanderAxon();
- int expansionFactor() { return m_nExpansionFactor; };
- void fireMap(void);
- void setInputCells(int anInt);
- void setExpansionFactor(int anInt) { if (m_nExpansionFactor != anInt) {m_nExpansionFactor = anInt; initialize();} };
- };
-
- #endif // __ExpanderAxon_H__
- */
-
- #ifndef __FuzzyAxon_H__
- #define __FuzzyAxon_H__
-
- typedef void (*FuzzyAxon_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *);
- typedef void (*FuzzyAxon_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, void *);
- typedef DLLData *(*FuzzyAxon_Constructor)(DLLData *, int, int, int *);
- typedef DLLData *(*FuzzyAxon_Constructor_CSW)(DLLData *, int, int, int *, void *);
-
- class FuzzyAxon: public Axon {
- public:
- int m_nMFCount;
- protected:
- int *m_WinningMF;
- NSFloat *m_WinningInput;
- NSFloat *m_MFOutput;
- SpatialAccess *MFOutputAccess;
- public:
- BOOL m_bOldFuzzyFormat;
- public:
- FuzzyAxon();
- ~FuzzyAxon();
- void activityAltered(void);
- virtual NSFloat applyMF(int paramIndex, NSFloat x) = 0;
- void constructDLL(void);
- const char *dllFunctionName();
- void fireDLL(void);
- void fireMap(void);
- NSFloat firingStrength(int index, BOOL callDLL = FALSE);
- void initialize();
- int MFMapping(int inputIndex, int outputIndex); //Comment for Single Connection
- int MFCount() { return m_nMFCount; };
- virtual int MFParameters() = 0;
- void setInputCells(int anInt);
- void setMFCount(int anInt) { if (m_nMFCount != anInt) {m_nMFCount = anInt; initialize();} };
- void setMFOutputAccess(SpatialAccess *aNSAccess);
- void setOldFuzzyFormat(BOOL aBool) { m_bOldFuzzyFormat = aBool; };
- NSFloat winningInput(int i) { return *(m_WinningInput + i); };
- int winningMF(int i) { return *(m_WinningMF + i); };
- };
-
- #endif // __FuzzyAxon_H__
-
- #ifndef __BellFuzzyAxon_H__
- #define __BellFuzzyAxon_H__
-
- class BellFuzzyAxon: public FuzzyAxon {
-
- public:
- NSFloat applyMF(int paramIndex, NSFloat x);
- int MFParameters() { return 3; };
- void networkRandomize();
- };
-
- #endif // __BellFuzzyAxon_H__
-
- #ifndef __GaussianFuzzyAxon_H__
- #define __GaussianFuzzyAxon_H__
-
- class GaussianFuzzyAxon: public FuzzyAxon {
-
- public:
- NSFloat applyMF(int paramIndex, NSFloat x);
- int MFParameters() { return 2; };
- void networkRandomize();
- };
-
- #endif // __GaussianFuzzyAxon_H__
-
- #ifndef __CombinerAxon_H__
- #define __CombinerAxon_H__
-
- class CombinerAxon: public Axon {
- public:
- CombinerAxon();
- void activityAltered(void);
- void fireMap(void);
- void setInputCells(int anInt);
- };
-
- #endif // __CombinerAxon_H__
-
-
- //NormalizedAxon
-
- #ifndef __NormalizedAxon_H__
- #define __NormalizedAxon_H__
-
- class NormalizedAxon: public Axon {
- private:
- NSFloat *m_WeightingFactorArray;
- int m_nWeightingFactorArraySize;
-
- public:
- NormalizedAxon() { m_nWeightingFactorArraySize = 0; m_WeightingFactorArray = NULL; };
- ~NormalizedAxon() { if (m_WeightingFactorArray) free(m_WeightingFactorArray); };
- void fireMap(void);
- NSFloat *weightingFactorArray() { return m_WeightingFactorArray; };
- };
-
- #endif // __NormalizedAxon_H__
-
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BiasAxon_H__
- #define __BiasAxon_H__
-
-
- typedef void (*BiasAxon_MAP)(DLLData *, NSFloat *, int, int, NSFloat *);
- typedef void (*BiasAxon_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, void *);
-
- class BiasAxon: public Axon {
- protected:
- void fireInline(register NSFloat &f, register NSFloat &fw) { f += fw; };
- public:
- const char *dllFunctionName();
- void fireDLL(void);
- void fireMap(void);
- void initialize(void);
- };
-
- #endif // __BiasAxon_H__
-
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LinearAxon_H__
- #define __LinearAxon_H__
-
-
- typedef void (*LinearAxon_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, NSFloat);
- typedef void (*LinearAxon_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, NSFloat, void *);
-
- class LinearAxon: public BiasAxon {
- protected:
- NSFloat m_fBeta;
- public:
- LinearAxon();
- NSFloat beta() { return m_fBeta; };
- const char *dllFunctionName();
- void fireInline(register NSFloat &f, register NSFloat &fw) { f *= m_fBeta; BiasAxon::fireInline(f,fw); };
- void fireDLL(void);
- void fireMap();
- virtual void setBeta(NSFloat aFloat) { m_fBeta = aFloat; };
- };
-
- #endif // __LinearAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SigmoidAxon_H__
- #define __SigmoidAxon_H__
-
-
- class SigmoidAxon: public LinearAxon {
- public:
- void fireInline(register NSFloat &f, register NSFloat &fw) { LinearAxon::fireInline(f,fw); f = 1.0f/(1.0f+(NSFloat)exp(-f));};
- void fireMap(void);
- };
-
- #endif // __SigmoidAxon_H__
-
-
- //NormalizedSigmoidAxon
-
- #ifndef __NormalizedSigmoidAxon_H__
- #define __NormalizedSigmoidAxon_H__
-
- class NormalizedSigmoidAxon: public SigmoidAxon {
- private:
- NSFloat *m_WeightingFactorArray;
- int m_nWeightingFactorArraySize;
-
- public:
- NormalizedSigmoidAxon() { m_nWeightingFactorArraySize = 0; m_WeightingFactorArray = NULL; };
- ~NormalizedSigmoidAxon() { if (m_WeightingFactorArray) free(m_WeightingFactorArray); };
- void fireMap(void);
- NSFloat *weightingFactorArray() { return m_WeightingFactorArray; };
- };
-
- #endif // __NormalizedSigmoidAxon_H__
-
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __TanhAxon_H__
- #define __TanhAxon_H__
-
-
- class TanhAxon: public LinearAxon {
- public:
- void fireInline(register NSFloat &f, register NSFloat &fw) { LinearAxon::fireInline(f,fw); f = (NSFloat)tanh(f); };
- void fireMap(void);
- };
-
- #endif // __TanhAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LinearSigmoidAxon_H__
- #define __LinearSigmoidAxon_H__
-
-
- class LinearSigmoidAxon: public SigmoidAxon {
- public:
- void fireInline(register NSFloat &f, register NSFloat &fw) { BiasAxon::fireInline(f,fw); f *= m_fBeta; if (f<0.0f) f=0.0f; else if (f>1.0f) f=1.0f; };
- void fireMap(void);
- };
-
- #endif // __LinearSigmoidAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LinearTanhAxonAxon_H__
- #define __LinearTanhAxonAxon_H__
-
-
- class LinearTanhAxon: public TanhAxon {
- public:
- void fireInline(register NSFloat &f, register NSFloat &fw) { BiasAxon::fireInline(f,fw); f *= m_fBeta; if (f<-1.0f) f=-1.0f; else if (f>1.0f) f=1.0f; };
- void fireMap(void);
- };
-
- #endif // __LinearTanhAxonAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SoftMaxAxon_H__
- #define __SoftMaxAxon_H__
-
-
- class SoftMaxAxon: public LinearAxon {
- public:
- SoftMaxAxon();
- void fireInline(register NSFloat &f, register NSFloat &fw) { f = 1.0f; };
- void fireMap(void);
- };
-
- #endif // __SoftMaxAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __WinnerTakeAllAxon_H__
- #define __WinnerTakeAllAxon_H__
-
-
- class WinnerTakeAllAxon: public Axon {
- protected:
- BOOL m_bMaxWinner;
- SpatialAccess *winningPEAccess;
- NSFloat m_fWinningPE;
-
- public:
- WinnerTakeAllAxon();
- ~WinnerTakeAllAxon();
- void fireMap(void);
- BOOL maxWinner() { return m_bMaxWinner; };
- void setMaxWinner(BOOL aBOOL) { m_bMaxWinner = aBOOL; };
- void setWinningPEAccess(SpatialAccess *anId);
- };
-
- #endif // __WinnerTakeAllAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __ThresholdAxon_H__
- #define __ThresholdAxon_H__
-
-
- class ThresholdAxon: public BiasAxon {
- public:
- void fireInline(register NSFloat &f, register NSFloat &fw) { BiasAxon::fireInline(f,fw); f = f>0? 1.0f: -1.0f; };
- void fireMap(void);
- };
-
- #endif // __ThresholdAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __GaussianAxon_H__
- #define __GaussianAxon_H__
-
-
- class GaussianAxon: public LinearAxon {
- protected:
- class FullSynapse *m_pFullSynapse;
- int m_iNeighbors, m_iMetric;
- BOOL m_bBetaDataLocal, m_bNormalize;
- public:
- class SpatialData *variance;
- GaussianAxon();
- ~GaussianAxon();
- void assignCenters();
- void assignVariance();
- void fireInline(NSFloat &f, NSFloat &fw, NSFloat &fv) { BiasAxon::fireInline(f,fw); f = (NSFloat)exp(-fv*f*f); };
- void fireMap(void);
- void initialize();
- void loadWeights(FILE *, unsigned short int version=100);
- void saveWeights(FILE *, BOOL addLineFeed=TRUE);
- int neighbors() { return m_iNeighbors; };
- int metric() { return m_iMetric; };
- void setBeta(NSFloat);
- void setBetaData(SpatialData *);
- void setMetric(int anInt) { m_iMetric = anInt; };
- void setNeighbors(int);
- void setFullSynapse(FullSynapse *anId) { m_pFullSynapse = anId; };
- void setNormalize(BOOL aBool) { m_bNormalize = aBool; };
- BOOL normalize() { return m_bNormalize; };
- };
-
- #endif // __GaussianAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __TDNNAxon_H__
- #define __TDNNAxon_H__
-
-
- typedef void (*TDNNAxon_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int);
- typedef void (*TDNNAxon_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, void *);
- typedef DLLData *(*TDNNAxon_Constructor)(DLLData *, int, int, int);
- typedef DLLData *(*TDNNAxon_Constructor_CSW)(DLLData *, int, int, int, void *);
-
- class TDNNAxon: public Axon {
- Soma *delayedReference;
- protected:
- int memoryTaps, delay;
- public:
- TDNNAxon();
- void activityAltered(void);
- void setTemporalDimension(int T);
- void loadWeights(FILE *, unsigned short int version=100);
- void saveWeights(FILE *, BOOL addLineFeed=TRUE);
- const char *dllFunctionName();
- void fireDLL(void);
- void fireMap(void);
- void initialize(void);
- void constructDLL(void);
- void incrementTime(void);
- void decrementTime(void);
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- void recallBufPosition(void);
- void setDelay(int anInt);
- void setInputCells(int anInt);
- void setOutputCells(int anInt);
- void setMemoryTaps(int anInt);
- void setTapDelay(int anInt);
- void setTaps(int anInt);
- void storeBufPosition(void);
- int tapDelay(void) { return delay; };
- int taps(void) { return memoryTaps; };
- NSFloat &Vd(int i) { return delayedReference->V(i); };
- void zeroState(void);
- ~TDNNAxon(void);
- };
-
- #endif // __TDNNAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __GammaAxon_H__
- #define __GammaAxon_H__
-
-
- typedef void (*GammaAxon_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int, NSFloat *);
- typedef void (*GammaAxon_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, NSFloat *, void *);
-
- class GammaAxon: public TDNNAxon {
- public:
- const char *dllFunctionName();
- void fireDLL(void);
- void fireMap(void);
- void initialize(void);
- void networkRandomize(void);
- void rangeLinks(void);
- };
-
- #endif // __GammaAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LaguarreAxon_H__
- #define __LaguarreAxon_H__
-
-
- class LaguarreAxon: public GammaAxon {
- public:
- void initialize(void);
- void fireMap(void);
- void networkRandomize(void);
- void rangeLinks(void);
- };
-
- #endif // __LaguarreAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __ContextAxon_H__
- #define __ContextAxon_H__
-
-
- typedef void (*ContextAxon_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, NSFloat);
- typedef void (*ContextAxon_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, NSFloat, void *);
-
- class ContextAxon: public LinearAxon {
- Soma *delayedReference;
- protected:
- int delay;
- public:
- ContextAxon();
- const char *dllFunctionName();
- void fireDLL(void);
- void fireMap(void);
- void incrementTime(void);
- void decrementTime(void);
- void initialize(void);
- void rangeLinks();
- void recallBufPosition(void);
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- void storeBufPosition(void);
- NSFloat &Vd(int i) { return delayedReference->V(i); };
- void zeroState(void);
- ~ContextAxon(void);
- };
-
- #endif // __ContextAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SigmoidContextAxon_H__
- #define __SigmoidContextAxon_H__
-
-
- class SigmoidContextAxon: public ContextAxon {
- public:
- void fireMap();
- };
-
- #endif // __SigmoidContextAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __TanhContextAxon_H__
- #define __TanhContextAxon_H__
-
-
- class TanhContextAxon: public ContextAxon {
- public:
- void fireMap();
- };
-
- #endif // __TanhContextAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __IntegratorAxon_H__
- #define __IntegratorAxon_H__
-
-
- class IntegratorAxon: public ContextAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __IntegratorAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SigmoidIntegratorAxon_H__
- #define __SigmoidIntegratorAxon_H__
-
-
- class SigmoidIntegratorAxon: public IntegratorAxon {
- public:
- void fireMap();
- };
-
- #endif // __SigmoidIntegratorAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __TanhIntegratorAxon_H__
- #define __TanhIntegratorAxon_H__
-
-
- class TanhIntegratorAxon: public IntegratorAxon {
- public:
- void fireMap();
- };
-
- #endif // __TanhIntegratorAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __Synapse_H__
- #define __Synapse_H__
-
-
- typedef void (*Synapse_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int, int);
- typedef void (*Synapse_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, void *);
- typedef DLLData *(*Synapse_Constructor)(DLLData *, int, int, int, int);
- typedef DLLData *(*Synapse_Constructor_CSW)(DLLData *, int, int, int, int, void *);
-
- class Synapse: public Soma {
- // class NAccess *initializationAccess;
- public:
- Axon *Last, *Feed;
- Synapse();
- ~Synapse();
- virtual void allocateSynapticLinks(void);
- void detachYourself(void);
- // void exemplarStarting(void) { initializationAccess->dataAt(&V(0)); };
- void constructDLL(void);
- const char *dllFunctionName();
- virtual void fireDLL();
- void fire(void);
- virtual void fireFeed(void);
- BOOL isASynapse(void) { return TRUE; };
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- void removeLast(Soma *aSoma);
- void removeNext(Soma *aSoma);
- void retryConnections();
- void setDLLFunction(DLLStruct *);
- // void setInitializationAccess(NAccess *);
- void setInputCells(int numberOfCells) { Soma::setInputCells(U()); };
- void setLast(Soma *aSoma);
- void setOutputCells(int numberOfCells) { Soma::setOutputCells(V()); };
- void setNext(Soma *aSoma);
- void setTemporalDimension(int T);
- void zeroState();
- };
-
- #endif __Synapse_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __FullSynapse_H__
- #define __FullSynapse_H__
-
-
- typedef void (*FullSynapse_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *);
- typedef void (*FullSynapse_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, void *);
-
- class FullSynapse: public Synapse {
- public:
- NSFloat &W(int i, int j) {return w(j+i*V());};
- void allocateSynapticLinks(void);
- const char *dllFunctionName();
- void linksAltered(void);
- void fireDLL();
- void fireFeed(void);
- };
-
- #endif // __FullSynapse_H__
-
- // SVMOutputSynapse
-
- #ifndef __SVMOutputSynapse_H__
- #define __SVMOutputSynapse_H__
-
-
- class SVMOutputSynapse: public FullSynapse {
-
- protected:
- NSFloat *m_fpDesiredMatrix;
- NSFloat *m_fSVMBiasVector;
- BOOL m_bRunningFirstEpoch;
-
- public:
- SVMOutputSynapse();
- NSFloat biasElement(int outIndex) { return m_fSVMBiasVector ? *(m_fSVMBiasVector+outIndex) : 0.0f; };
- NSFloat desiredElement(int outIndex, int exemplar) { return m_fpDesiredMatrix ? *(m_fpDesiredMatrix+outIndex*V()+exemplar) : 0.0f; };
- void epochEnded();
- void fireFeed(void);
- void linksAltered(void);
- void loadStateVariables(FILE *file, unsigned short int version);
- void networkReset();
- void saveStateVariables(FILE *file);
- void setBiasElement(int outIndex, NSFloat aFloat) { if (m_fSVMBiasVector) *(m_fSVMBiasVector+outIndex) = aFloat; };
- void setDesiredElement(int outIndex, int exemplar, NSFloat aFloat);
- void setRunningFirstEpoch(BOOL aBool) { m_bRunningFirstEpoch = aBool; };
- BOOL runningFirstEpoch() { return m_bRunningFirstEpoch; };
- void updateSVMBiasElement(int outIndex, int exemplar, NSFloat dAlpha) { if (m_fSVMBiasVector && m_fpDesiredMatrix) *(m_fSVMBiasVector+outIndex) += *(m_fpDesiredMatrix+outIndex*V()+exemplar) * dAlpha; };
- };
-
- #endif // __SVMOutputSynapse_H__
-
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __ArbitrarySynapse_H__
- #define __ArbitrarySynapse_H__
-
-
- class ArbitrarySynapse: public Synapse {
- class ConnectionList *connections;
- public:
- ArbitrarySynapse();
- void loadWeights(FILE *, unsigned short int version=100);
- void saveWeights(FILE *, BOOL addLineFeed=TRUE);
- ConnectionList *connectionList(void) { return connections;};
- const char *dllFunctionName();
- void fireFeed();
- void freeConnectionList();
- void useConnectionList(ConnectionList *aList) { connections = aList; };
- };
-
- #endif // __ArbitrarySynapse_H__
-
- // Author: Wesley Curtis Lefebvre
- // Name: FunctionIO.h
-
- #ifndef __FunctionIO_h__
- #define __FunctionIO_h__
-
-
- typedef void (*FunctionIO_MAP)(NSFloat *, int, int);
- typedef void (*FunctionIO_MAP_CSW)(NSFloat *, int, int, void *);
-
- class FunctionIO: public InputSpatialData
- {
- protected:
- void *m_pFunction;
- void *m_pCallingObject;
- RW m_readWrite;
- public:
- FunctionIO();
- void reportSpatialData();
- void setFunction(void *aFunction, void *callingObject=NULL);
- void setMode(RW readWrite);
- };
-
- #endif // __FunctionIO_h__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackAxon_H__
- #define __BackAxon_H__
-
-
- typedef void (*BackAxon_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *);
- typedef void (*BackAxon_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, void *);
- typedef DLLData *(*BackAxon_Constructor)(DLLData *, DLLData *, int, int);
- typedef DLLData *(*BackAxon_Constructor_CSW)(DLLData *, DLLData *, int, int, void *);
-
- class BackAxon: public Axon {
- protected:
- BOOL gradientsEnabled;
- NSFloat *m_fWeightingVector;
- int m_nWeightingVectorSize;
- int m_nCurrentExemplar;
- public:
- Axon *Dual;
- public:
- BackAxon();
- void activityAltered();
- void linksAltered();
- virtual void backpropComplete();
- void backpropStarting();
- void constructDLL();
- void networkRandomize();
- void setBackpropOffset(int);
- void setCurrentExemplar(int exemplar);
- virtual void setDual(Soma *);
- void setGradientsEnabled(BOOL);
- void setWeightingVector(NSFloat *aVector, int vectorSize);
- void updateExemplarCounter();
- // Overridden virtual functions
- const char *dllFunctionName();
- void fireDLL();
- void fire();
- void incrementTime();
- void setInputCells(int) { Soma::setInputCells(U()); };
- void setOutputCells(int) { Soma::setOutputCells(V()); };
- };
-
- #endif // __BackAxon_H__
-
- //BackFuzzyAxon
-
- #ifndef __BackFuzzyAxon_H__
- #define __BackFuzzyAxon_H__
-
- typedef void (*BackFuzzyAxon_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, int, int, NSFloat, NSFloat *);
- typedef void (*BackFuzzyAxon_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, int, int, NSFloat, NSFloat *, void *);
-
- class BackFuzzyAxon: public BackAxon {
- public:
- // DLL Code Here
- void activityAltered(void);
- NSFloat computeDerivative(int weightIndex, int outputIndex, BOOL dllActive);
- const char *dllFunctionName();
- virtual NSFloat derivative(int weightIndex, int outputIndex) = 0;
- void fireDLL(void);
- void fireMap();
- void initialize();
- };
-
- #endif // __BackFuzzyAxon_H__
-
- //BackBellFuzzyAxon
-
- #ifndef __BackBellFuzzyAxon_H__
- #define __BackBellFuzzyAxon_H__
-
- class BackBellFuzzyAxon: public BackFuzzyAxon {
- public:
- // DLL Code Here
- NSFloat derivative(int weightIndex, int outputIndex);
- };
-
- #endif // __BackBellFuzzyAxon_H__
-
- //BackGaussianFuzzyAxon
-
- #ifndef __BackGaussianFuzzyAxon_H__
- #define __BackGaussianFuzzyAxon_H__
-
- class BackGaussianFuzzyAxon: public BackFuzzyAxon {
- public:
- // DLL Code Here
- NSFloat derivative(int weightIndex, int outputIndex);
- };
-
- #endif // __BackGaussianFuzzyAxon_H__
-
- //BackCombinerAxon
-
- #ifndef __BackCombinerAxon_H__
- #define __BackCombinerAxon_H__
-
- class BackCombinerAxon: public BackAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackCombinerAxon_H__
-
-
- //BackNormalizedAxon
-
- #ifndef __BackNormalizedAxon_H__
- #define __BackNormalizedAxon_H__
-
- class BackNormalizedAxon: public BackAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackNormalizedAxon_H__
-
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackBiasAxon_H__
- #define __BackBiasAxon_H__
-
-
- typedef void (*BackBiasAxon_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *);
- typedef void (*BackBiasAxon_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, void *);
-
- class BackBiasAxon: public BackAxon {
- public:
- const char *dllFunctionName();
- void fireDLL();
- void fireMap();
- void initialize();
- };
-
- #endif // __BackBiasAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackLinearAxon_H__
- #define __BackLinearAxon_H__
-
-
- typedef void (*BackLinearAxon_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *,NSFloat);
- typedef void (*BackLinearAxon_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *,NSFloat,void *);
-
- class BackLinearAxon: public BackBiasAxon {
- protected:
- NSFloat m_fOffset;
- class LinearAxon *linearAxon() { return (LinearAxon*)Dual; };
- public:
- BackLinearAxon();
- const char *dllFunctionName();
- void fireDLL();
- void fireMap();
- NSFloat offset() { return m_fOffset; };
- void setOffset(NSFloat aFloat) { m_fOffset = aFloat; };
- };
-
- #endif // __BackLinearAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackSigmoidAxon_H__
- #define __BackSigmoidAxon_H__
-
-
- class BackSigmoidAxon: public BackLinearAxon {
- public:
- void fireMap();
- };
-
- #endif // __BackSigmoidAxon_H__
-
- //BackNormalizedSigmoidAxon
-
- #ifndef __BackNormalizedSigmoidAxon_H__
- #define __BackNormalizedSigmoidAxon_H__
-
- class BackNormalizedSigmoidAxon: public BackSigmoidAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackNormalizedSigmoidAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackTanhAxon_H__
- #define __BackTanhAxon_H__
-
-
- class BackTanhAxon: public BackLinearAxon {
- public:
- void fireMap();
- };
-
- #endif // __BackTanhAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackTDNNAxon_H__
- #define __BackTDNNAxon_H__
-
-
- typedef void (*BackTDNNAxon_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, NSFloat *);
- typedef void (*BackTDNNAxon_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, NSFloat *, void *);
- typedef DLLData *(*BackTDNNAxon_Constructor)(DLLData *, DLLData *, int, int, int);
- typedef DLLData *(*BackTDNNAxon_Constructor_CSW)(DLLData *, DLLData *, int, int, int, void *);
-
- class BackTDNNAxon: public BackAxon {
- Soma *delayedReference;
- protected:
- int memoryTaps;
- public:
- BackTDNNAxon();
- void activityAltered(void);
- void backpropComplete();
- void constructDLL(void);
- const char *dllFunctionName();
- void fireDLL();
- void fireMap(void);
- void incrementTime(void);
- void initialize(void);
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- void setMemoryTaps(int anInt);
- int taps(void) { return memoryTaps; };
- NSFloat &Vd(int i) { return delayedReference->V(i); };
- void zeroState(void);
- ~BackTDNNAxon(void);
- };
-
- #endif // __BackTDNNAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackGammaAxon_H__
- #define __BackGammaAxon_H__
-
-
- typedef void (*BackGammaAxon_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, NSFloat *, NSFloat *, NSFloat *);
- typedef void (*BackGammaAxon_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, NSFloat *, NSFloat *, NSFloat *, void *);
-
- class BackGammaAxon: public BackTDNNAxon {
- public:
- const char *dllFunctionName();
- void fireDLL();
- void fireMap(void);
- void initialize(void);
- };
-
- #endif // __BackGammaAxon_H__
-
- // Author: Wesley Curtis Lefebvre
- // Name: Connection.h
-
- #ifndef __Connection_h__
- #define __Connection_h__
-
-
- class Connection {
- int fromIndex, *toIndices, toCount, toAllocated;
- public:
- Connection();
- ~Connection();
- void addConnection(int index);
- void allocateConnections(int number);
- int *connections(void) { return toIndices; };
- int count(void) { return toCount; };
- void empty(void);
- int feedingIndex(void) { return fromIndex; };
- void insertConnectionAt(int toIndex, int index);
- void removeConnection(int index);
- void setIndex(int index) {fromIndex = index; };
- Connection &operator=(Connection &aConnection);
- };
-
- #endif // __Connection_h__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __ConnectionList_h__
- #define __ConnectionList_h__
-
-
- class ConnectionList {
- class Connection **synapse;
- int synapseCount, synapseAllocated;
- public:
- ConnectionList();
- ~ConnectionList(void);
- void addConnection(int fromIndex, int toIndex);
- void allocateSynapse(int number);
- Connection *connectionAt(int index) { return synapse[index]; };
- int count(void) { return synapseCount; };
- void empty(void);
- void insertConnectionAt(int fromIndex, int toIndex, int index);
- void removeConnection(int fromIndex, int toIndex);
- int weights(void);
- };
-
- #endif // __ConnectionList_h__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackLaguarreAxon_H__
- #define __BackLaguarreAxon_H__
-
-
- class BackLaguarreAxon: public BackGammaAxon {
- public:
- void fireMap(void);
- void initialize(void);
- };
-
- #endif // __BackLaguarreAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackContextAxon_H__
- #define __BackContextAxon_H__
-
-
- typedef void (*BackContextAxon_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, NSFloat *, NSFloat, NSFloat *);
- typedef void (*BackContextAxon_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, NSFloat *, NSFloat, NSFloat *, void *);
-
- class BackContextAxon: public BackLinearAxon {
- protected:
- Soma *delayedReference;
- NSFloat m_fOffset;
- public:
- BackContextAxon();
- const char *dllFunctionName();
- void fireDLL(void);
- void fireMap(void);
- void incrementTime(void);
- void initialize(void);
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- NSFloat &Vd(int i) { return delayedReference->V(i); };
- void zeroState(void);
- ~BackContextAxon(void);
- };
-
- #endif // __BackContextAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackSigmoidContextAxon_H__
- #define __BackSigmoidContextAxon_H__
-
-
- class BackSigmoidContextAxon: public BackContextAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackSigmoidContextAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackTanhContextAxon_H__
- #define __BackTanhContextAxon_H__
-
-
- class BackTanhContextAxon: public BackContextAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackTanhContextAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackIntegratorAxon_H__
- #define __BackIntegratorAxon_H__
-
-
- class BackIntegratorAxon: public BackContextAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackIntegratorAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackSigmoidIntegratorAxon_H__
- #define __BackSigmoidIntegratorAxon_H__
-
-
- class BackSigmoidIntegratorAxon: public BackIntegratorAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackSigmoidIntegratorAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackTanhIntegratorAxon_H__
- #define __BackTanhIntegratorAxon_H__
-
-
- class BackTanhIntegratorAxon: public BackIntegratorAxon {
- public:
- void fireMap(void);
- };
-
- #endif // __BackTanhIntegratorAxon_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackSynapse_H__
- #define __BackSynapse_H__
-
-
- typedef void (*BackSynapse_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *);
- typedef void (*BackSynapse_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, void *);
- typedef DLLData *(*BackSynapse_Constructor)(DLLData *, DLLData *, int, int, int, int);
- typedef DLLData *(*BackSynapse_Constructor_CSW)(DLLData *, DLLData *, int, int, int, int, void *);
-
- class BackSynapse: public Synapse {
- protected:
- BOOL gradientsEnabled;
- NSFloat *m_fWeightingVector;
- int m_nWeightingVectorSize;
- int m_nCurrentExemplar;
- public:
- Synapse *Dual;
- public:
- BackSynapse();
- void activityAltered();
- const char *dllFunctionName();
- void fireDLL();
- void linksAltered();
- void backpropComplete();
- void backpropStarting();
- void constructDLL();
- void networkRandomize();
- virtual void setDual(Soma *);
- void setCurrentExemplar(int exemplar);
- void setGradientsEnabled(BOOL);
- void setWeightingVector(NSFloat *aVector, int vectorSize);
- void updateExemplarCounter();
- // Overridden virtual functions
- void fire();
- void incrementTime();
- };
-
- #endif // __BackSynapse_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackFullSynapse_H__
- #define __BackFullSynapse_H__
-
-
- typedef void (*BackFullSynapse_MAP)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat *, NSFloat *);
- typedef void (*BackFullSynapse_MAP_CSW)(DLLData *, DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat *, NSFloat *, void *);
-
- class BackFullSynapse: public BackSynapse {
- protected:
- NSFloat &W(int i, int j) { return Dual->w(i+j*U()); };
- public:
- void allocateSynapticLinks();
- const char *dllFunctionName();
- void fireDLL();
- void fireFeed();
- void linksAltered();
- };
-
- #endif // __BackFullSynapse_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackArbitrarySynapse_H__
- #define __BackArbitrarySynapse_H__
-
-
- class BackArbitrarySynapse: public BackSynapse {
- class ConnectionList *connections;
- public:
- void allocateSynapticLinks(void);
- const char *dllFunctionName();
- void fireFeed(void);
- void setDual(Soma *aSoma);
- };
-
- #endif // __BackArbitrarySynapse_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __BackCriteriaControl_H__
- #define __BackCriteriaControl_H__
-
-
- class BackCriteriaControl: public BackAxon {
- protected:
- BOOL streamFixed;
- protected:
- void fireMap();
- public:
- BackCriteriaControl();
- const char *dllFunctionName();
- void fixStream(BOOL aFlag) { streamFixed = aFlag; };
- void incrementTime();
- };
-
- #endif // __BackCriteriaControl_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __Criterion_H__
- #define __Criterion_H__
-
-
- typedef NSFloat (*Criterion_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, BOOL);
- typedef NSFloat (*Criterion_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, NSFloat *, BOOL, void *);
-
- class Criterion: public Axon {
- int m_iSaveCounter,
- tempCounter,
- m_iCheckCostEvery,
- m_iSensitivityCounter;
- NSFloat *m_fWeightingVector;
- int m_nWeightingVectorSize;
- int m_nCurrentExemplar,
- m_nTotalNetworkWeights,
- m_nConfusionRows;
- public:
- int costCounter;
- BOOL m_bIgnoreNextError;
- NSFloat *m_fOffsetVector;
-
- protected:
- BOOL testing,
- m_bAutoSave,
- m_bOnIncrease,
- m_bTrainBestCostUpdated,
- m_bSensitivity;
- double *m_dfSumYY,
- *m_dfSumY,
- *m_dfTempSumY,
- *m_dfSumXY,
- *m_dfSumX,
- *m_dfSumXX,
- *m_dfTempSumXY,
- *m_dfTempSumX,
- *m_dfTempSumXX,
- *m_dfTempSumYY;
- NSFloat E,
- m_fRunningMSE,
- m_fTempRunningMSE,
- m_fTempPercentError,
- runningE,
- m_fPercentError,
- m_fConfusionThreshold,
- m_fCorrelationAverage,
- m_fNMSE,
- m_fAIC,
- m_fMDL,
- *m_fROC,
- *m_fTempConfusion,
- *m_fConfusion,
- *m_fPerformanceMeasures,
- *m_fConfusionAsPercent,
- *m_fCorrelation,
- m_fLastReportedTrainBestCost,
- m_fLastReportedTestBestCost,
- m_fLastReportedTestCost,
- m_fLastReportedTrainCost,
- m_fLastUncheckedCost,
- m_fBestCost,
- m_fLastCost,
- m_nROCMinValue,
- m_nROCMaxValue,
- tempE,
- *desired;
- SpatialAccess *costAccess,
- *runningCostAccess,
- *performanceMeasuresAccess,
- *confusionAccess,
- *rOCAccess,
- *confusionAsPercentAccess,
- *correlationAccess,
- *desiredAccess;
- SpatialData *m_pFixedOutput,
- *m_pSensitivity,
- *m_pRawSensitivity,
- *m_pSensitivityTotals;
- BOOL m_bSensitivityDataLocal,
- m_bRawSensitivityDataLocal,
- m_bSensitivityTotalsDataLocal;
- int m_nROCThresholds,
- m_nROCChannel,
- *m_nTempROCCounters,
- *m_nROCCounters;
- public:
- Criterion();
- ~Criterion();
- BOOL autoSave() { return m_bAutoSave; };
- NSFloat bestCost() { return m_fBestCost; };
- BOOL checkForSaveBest(BOOL, NSFloat, BOOL);
- BOOL checkForSaveBest(NSFloat, BOOL);
- void computePerformanceStats();
- virtual void determineCost();
- virtual void determineCostDerivative()=0;
- const char *dllFunctionName();
- void epochEnded();
- void fireDLL();
- virtual void fireGetReady();
- void fireMap();
- void fireSensitivity();
- void incrementTime();
- void ignoreNextError();
- void initialize();
- NSFloat lastReportedTestCost() { return m_fLastReportedTestCost; };
- NSFloat lastReportedTrainCost() { return m_fLastReportedTrainCost; };
- NSFloat lastUncheckedCost() { return m_fLastUncheckedCost; };
- void networkRandomize();
- void networkReset();
- void phaseEnded(int counter);
- NSFloat reportCost(BOOL reportSpatial = TRUE, BOOL resetCounter = TRUE);
- void reportPerformanceAccess();
- int saveCounter() { return m_iSaveCounter; };
- BOOL sensitivity() { return m_bSensitivity; };
- void setAutoSave(BOOL aBool) { m_bAutoSave = aBool; };
- void setBestCost(NSFloat aFloat) { m_fBestCost = aFloat; };
- void setCheckCostEvery(int anInt) { m_iCheckCostEvery = anInt; };
- void setConfusionAccess(SpatialAccess* anId);
- void setConfusionAsPercentAccess(SpatialAccess* anId);
- void setConfusionThreshold(NSFloat aFloat) { m_fConfusionThreshold = aFloat; };
- void setCorrelationAccess(SpatialAccess* anId);
- void setCostAccess(SpatialAccess *);
- void setCurrentExemplar(int exemplar);
- void setDesiredAccess(SpatialAccess *);
- void setOnIncrease(BOOL aBool) { m_bOnIncrease = aBool; };
- void setOffsetVector(NSFloat *aFloatPointer) { m_fOffsetVector = aFloatPointer; }
- void setPerformanceMeasuresAccess(SpatialAccess *anId);
- void setRunningCostAccess(SpatialAccess *);
- void setRawSensitivityData(SpatialData *anId);
- void setROCAccess(SpatialAccess* anId);
- void setROCThresholds(int anInt) { m_nROCThresholds = anInt; initialize(); };
- void setROCChannel(int anInt) { m_nROCChannel = anInt; };
- void setROCMinValue(NSFloat aFloat) { m_nROCMinValue = aFloat; };
- void setROCMaxValue(NSFloat aFloat) { m_nROCMaxValue = aFloat; };
- void setSaveCounter(int anInt) { m_iSaveCounter = anInt; };
- void setSensitivityData(SpatialData *);
- void setSensitivityTotalsData(SpatialData *);
- void setSensitivity(BOOL);
- virtual NSFloat setTesting(BOOL);
- void setTotalNetworkWeights(int anInt) { m_nTotalNetworkWeights = anInt; };
- void setSensitivityInputs(int);
- void setWeightingVector(NSFloat *aVector, int vectorSize);
- void updateWeightedCost();
- BOOL isTesting() { return testing; };
- };
-
- #endif // __Criterion_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __L1Criterion_H__
- #define __L1Criterion_H__
-
-
- class L1Criterion: public Criterion {
- protected:
- void determineCost();
- void determineCostDerivative();
- };
-
- #endif // __L1Criterion_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __L2Criterion_H__
- #define __L2Criterion_H__
-
-
- class L2Criterion: public Criterion {
- protected:
- void determineCost();
- void determineCostDerivative();
- };
-
- #endif // __L2Criterion_H__
-
- // SVML2Criterion
-
- #ifndef __SVML2Criterion_H__
- #define __SVML2Criterion_H__
-
-
- class SVML2Criterion: public L2Criterion {
- private:
- SVMOutputSynapse *m_pOutputSynapse;
- BOOL m_bRunningFirstEpoch;
- int m_nExemplarCount;
-
- public:
- SVML2Criterion();
- void determineCost();
- void determineCostDerivative();
- void epochEnded();
- int exemplarCount() { return m_nExemplarCount; };
- void loadStateVariables(FILE *file, unsigned short int version);
- void networkReset();
- BOOL runningFirstEpoch() { return m_bRunningFirstEpoch; };
- void saveStateVariables(FILE *file);
- void setSVMOutputSynapse(SVMOutputSynapse *aSynapse) { m_pOutputSynapse = aSynapse; };
- void setExemplarCount(int anInt) { m_nExemplarCount = anInt; };
- void setRunningFirstEpoch(BOOL aBool) { m_bRunningFirstEpoch = aBool; };
-
- };
-
- #endif // __SVML2Criterion_H__
-
- // L2TemporalCriterion
-
- #ifndef __L2TemporalCriterion_H__
- #define __L2TemporalCriterion_H__
-
-
- class L2TemporalCriterion: public Criterion {
- protected:
- NSFloat m_fLargeChangeRightDirectionScale,
- m_fLargeChangeWrongDirectionScale,
- m_fSmallChangeRightDirectionScale,
- m_fSmallChangeWrongDirectionScale,
- m_fRightDirectionScale,
- m_fWrongDirectionScale,
- m_fLargeChangeScale,
- m_fSmallChangeScale,
- *m_fLastActivity,
- *m_fLastDesired,
- m_fDiscountRate,
- *m_fOverallScale;
- BOOL m_bMagnitudeOfChange,
- m_bDirectionOfChange,
- m_bMemoryNeedsReallocating,
- m_bDataPreDifferenced,
- m_bRecencyOfObservation;
- int m_nActiveNumberOfExemplars,
- m_nCVNumberOfExemplars,
- m_nNumberOfExemplars,
- m_nExemplarNumber,
- m_nMode;
-
- void determineCost();
- void determineCostDerivative();
- NSFloat determineDirectionalProfitScale(NSFloat desired, NSFloat lastDesired, NSFloat activity, NSFloat lastActivity, NSFloat standardDeviation, NSFloat normalizationOffset);
- NSFloat determineDirectionScale(NSFloat desired, NSFloat lastDesired, NSFloat activity, NSFloat lastActivity, NSFloat normalizationOffset);
- NSFloat determineMagnitudeScale(NSFloat desired, NSFloat lastDesired, NSFloat standardDeviation);
- NSFloat determineRecencyScale();
- void initialize(void);
- void linksAltered(void);
-
- public:
- L2TemporalCriterion();
- ~L2TemporalCriterion();
- void epochEnded();
- void fireGetReady();
- void networkReset();
- NSFloat setTesting(BOOL);
- NSFloat largeChangeRightDirectionScale() { return m_fLargeChangeRightDirectionScale; };
- NSFloat largeChangeWrongDirectionScale() { return m_fLargeChangeWrongDirectionScale; };
- NSFloat smallChangeRightDirectionScale() { return m_fSmallChangeRightDirectionScale; };
- NSFloat smallChangeWrongDirectionScale() { return m_fSmallChangeWrongDirectionScale; };
- NSFloat rightDirectionScale() { return m_fRightDirectionScale; };
- NSFloat wrongDirectionScale() { return m_fWrongDirectionScale; };
- NSFloat largeChangeScale() { return m_fLargeChangeScale; };
- NSFloat smallChangeScale() { return m_fSmallChangeScale; };
- NSFloat discountRate() { return m_fDiscountRate; };
- BOOL magnitudeOfChange() { return m_bMagnitudeOfChange; };
- BOOL directionOfChange() { return m_bDirectionOfChange; };
- BOOL recencyOfObservation() { return m_bRecencyOfObservation; };
- BOOL dataPreDifferenced() { return m_bDataPreDifferenced; };
- void setActiveNumberOfExemplars(int anInt) { m_nActiveNumberOfExemplars = anInt; };
- void setCVNumberOfExemplars(int anInt) { m_nCVNumberOfExemplars = anInt; };
- void setLargeChangeRightDirectionScale(NSFloat aFloat) { m_fLargeChangeRightDirectionScale = aFloat; };
- void setLargeChangeWrongDirectionScale(NSFloat aFloat) { m_fLargeChangeWrongDirectionScale = aFloat; };
- void setSmallChangeRightDirectionScale(NSFloat aFloat) { m_fSmallChangeRightDirectionScale = aFloat; };
- void setSmallChangeWrongDirectionScale(NSFloat aFloat) { m_fSmallChangeWrongDirectionScale = aFloat; };
- void setRightDirectionScale(NSFloat aFloat) { m_fRightDirectionScale = aFloat; };
- void setWrongDirectionScale(NSFloat aFloat) { m_fWrongDirectionScale = aFloat; };
- void setLargeChangeScale(NSFloat aFloat) { m_fLargeChangeScale = aFloat; };
- void setSmallChangeScale(NSFloat aFloat) { m_fSmallChangeScale = aFloat; };
- void setDiscountRate(NSFloat aFloat) { m_fDiscountRate = aFloat; };
- void setMagnitudeOfChange(BOOL aBool) { m_bMagnitudeOfChange = aBool; m_bMemoryNeedsReallocating = TRUE; m_nMode = ((int) m_bRecencyOfObservation) * 1 + ((int) m_bDirectionOfChange) * 2 + ((int) m_bMagnitudeOfChange) * 4; };
- void setDirectionOfChange(BOOL aBool) { m_bDirectionOfChange = aBool; m_bMemoryNeedsReallocating = TRUE; m_nMode = ((int) m_bRecencyOfObservation) * 1 + ((int) m_bDirectionOfChange) * 2 + ((int) m_bMagnitudeOfChange) * 4; };
- void setRecencyOfObservation(BOOL aBool) { m_bRecencyOfObservation = aBool; m_bMemoryNeedsReallocating = TRUE; m_nMode = ((int) m_bRecencyOfObservation) * 1 + ((int) m_bDirectionOfChange) * 2 + ((int) m_bMagnitudeOfChange) * 4; };
- void setDataPreDifferenced(BOOL aBool) { m_bDataPreDifferenced = aBool; m_bMemoryNeedsReallocating = TRUE; };
- void setExemplarNumber(int anInt) { m_nExemplarNumber = anInt; };
- };
-
- #endif // __L2TemporalCriterion_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LpCriterion_H__
- #define __LpCriterion_H__
-
-
- class LpCriterion: public Criterion {
- int m_nP;
- protected:
- void determineCost();
- void determineCostDerivative();
- public:
- void setP(int anInt);
- int p() { return m_nP; };
- LpCriterion();
- };
-
- #endif // __LpCriterion_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LinfinityCriterion_H__
- #define __LinfinityCriterion_H__
-
-
- class LinfinityCriterion: public Criterion {
- protected:
- void determineCost();
- void determineCostDerivative();
- };
-
- #endif // __LinfinityCriterion_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __Gradient_H__
- #define __Gradient_H__
-
-
- class Gradient {
- NSFloat maxWeight;
- public:
- class Soma *errorSoma;
- class Soma *forwardSoma;
- protected:
- DLLStruct *dllStruct;
- void *m_pCallingObject;
- Gradient **m_Gradient;
- Criterion *m_Criterion;
- int m_nGradientCount;
- public:
- int linksAllocated;
- Gradient();
- virtual ~Gradient();
- virtual void allocateGradientPointers(int anInt);
- virtual void allocateLinks(int anInt);
- virtual void constructDLL();
- virtual void destroyDLL(DLLData *);
- virtual void fireGetReady();
- virtual void initializeDLL();
- virtual const char *dllFunctionName();
- virtual void loadWeights(FILE *, unsigned short int version=100);
- virtual void loadStateVariables(FILE *file, unsigned short int version);
- virtual void saveWeights(FILE *);
- virtual void saveStateVariables(FILE *file);
- virtual void networkRandomize(void);
- void setCriterion(Criterion *aCriterion);
- virtual void setDLLFunction(DLLStruct *aDLL);
- void setDLL(void *function, void *constructor=NULL, void *destructor=NULL, void *instance=NULL, void *callingObject=NULL);
- void setErrorSoma(Soma *aSoma);
- void setGradient(Gradient *aGradient, int index);
- virtual void setWeightLimit(NSFloat aFloat);
- virtual void update(Soma *aSoma);
- virtual void updateDLL(Soma *aSoma);
- void updateWeights(Soma *aSoma);
- NSFloat weightLimit(void) {return maxWeight;};
- virtual void networkReset(void);
- };
-
- #endif // __Gradient_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __Step_H__
- #define __Step_H__
-
-
- typedef DLLData *(*Step_Constructor)(DLLData *, int, BOOL);
- typedef DLLData *(*Step_Constructor_CSW)(DLLData *, int, BOOL, void *);
- typedef void (*Step_MAP)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL, int, BOOL, NSFloat);
- typedef void (*Step_MAP_CSW)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL, int, BOOL, NSFloat, void *);
-
- class Step: public Gradient {
- int stepCount;
- protected:
- NSFloat m_fDefaultStepSize, *stepSize;
- SpatialAccess *stepAccess;
- BOOL individualSteps;
- BOOL m_bDecayWeights;
- NSFloat m_fDecayRate;
- int m_nStepDivisor;
-
- public:
- Step();
- void addToStepSize(NSFloat aFloat);
- void constructDLL();
- const char *dllFunctionName();
- NSFloat defaultStepSize(void) { return m_fDefaultStepSize; };
- void multByStepSize(NSFloat aFloat);
- virtual void setIndividualSteps(BOOL aFlag);
- void setDefaultStepSize(NSFloat aFloat);
- void setDecayRate(NSFloat aFloat) { m_fDecayRate = aFloat; };
- void setDecayWeights(BOOL aBool) { m_bDecayWeights = aBool; };
- void setStepAccess(SpatialAccess *anNSAccess);
- void setStepDivisor(int anInt) { m_nStepDivisor = anInt; };
- NSFloat &step(int i) { return (individualSteps && (i<stepCount))? *(stepSize+i): *stepSize; };
- int step(void) { return stepCount; };
- // Overwritten virtual functions
- void allocateLinks(int anInt);
- void networkReset(void);
- void update(Soma *aSoma);
- void updateDLL(Soma *aSoma);
- virtual ~Step(void);
- };
-
- #endif // __Step_H__
-
- #ifndef __SVMStep_H__
- #define __SVMStep_H__
-
- class SVMStep: public Step {
- protected:
- int m_nExemplarCount;
- BOOL m_bRunningFirstEpoch;
-
- public:
- SVMStep();
- void epochEnded();
- int exemplarCount() { return m_nExemplarCount; };
- void loadStateVariables(FILE *file, unsigned short int version);
- void networkReset();
- BOOL runningFirstEpoch() { return m_bRunningFirstEpoch; };
- void saveStateVariables(FILE *file);
- void setExemplarCount(int anInt) { m_nExemplarCount = anInt; };
- void setRunningFirstEpoch(BOOL aBool) { m_bRunningFirstEpoch = aBool; };
- void update(Soma *aSoma);
- };
-
- #endif // __SVMStep_H__
-
- //ConjugateGradient
-
- #ifndef __ConjugateGradient_H__
- #define __ConjugateGradient_H__
-
-
- //typedef DLLData *(*ConjugateGradient_Constructor)(DLLData *, int, BOOL);
- //typedef DLLData *(*ConjugateGradient_Constructor_CSW)(DLLData *, int, BOOL, void *);
- //typedef void (*ConjugateGradient_MAP)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL);
- //typedef void (*ConjugateGradient_MAP_CSW)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL, void *);
- class CGVars {
- public:
- int linksAllocated;
- NSFloat *gradient;
- NSFloat *StoredWeightOnFireConclude;
- NSFloat *StoredWeight;
- /*
- NSFloat *Pvec;
- NSFloat *Gvec;
- NSFloat *SKvec;
- */
- double *Pvec;
- double *Gvec;
- double *SKvec;
-
- NSFloat *weight;
-
- CGVars();
- // void operator=(CGVars var1);
- void operator++(void);
- void store_weight(void);
- void reload_weight(void);
- void store_weight_conclude(void);
- void reload_weight_conclude(void);
- void store_info(Gradient *);
-
- };
-
- class CGGlobals {
- public:
- // NSFloat Lambda, LambdaBar, MSE, MSEOld, Sigma, SigmaK, AlphaK, MuK, DeltaK;
- double Lambda, LambdaBar, MSE, MSEOld, Sigma, SigmaK, AlphaK, MuK, DeltaK;
- BOOL Success,Initialized,checkMSE,WeightsRandomized, weightsStoredOnFireConclude;
- int NumWeights, EpochNumber;
- void initializeGlobals(void);
- };
-
- class ConjugateGradient: public Gradient {
-
- public:
- NSFloat *StoredWeightsOnFireConclude;
- NSFloat *StoredWeights;
- /*
- NSFloat *Pvec;
- NSFloat *Gvec;
- NSFloat *SKvec;
- */
- double *Pvec;
- double *Gvec;
- double *SKvec;
-
- protected:
- BOOL m_bMasterGradient;
- int grad_comp_num;
- int m_nActiveNumberOfExemplars;
-
- CGVars m_firstvar_cgvars,
- m_firstweight_cgvars;
-
- public:
- CGGlobals *cgg;
- ConjugateGradient();
- virtual ~ConjugateGradient(void);
- // void constructDLL();
- // const char *dllFunctionName();
- // Overwritten virtual functions
- void allocateLinks(int anInt);
- void epochEnded(int counter);
- void fireGetReady();
- BOOL masterGradient() { return m_bMasterGradient; };
- void networkReset(void);
- void phaseEnded(int counter);
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- void setMasterGradient(BOOL aBool);
- void update(Soma *aSoma);
- void storeOldWeights(void);
- void storeOldWeightsOnFireConclude(void); // I don't think this is needed
- void reloadOldWeights(void);
- void reloadOldWeightsOnFireConclude(void);
- void resetGradients(void);
- void initializeVariables(void);
- void setActiveNumberOfExemplars(int anInt) { m_nActiveNumberOfExemplars = anInt; };
- void networkRandomize(void);
- void fireConclude(void);
- CGVars *first_weight(void);
- CGVars *next_weight(CGVars *);
- CGVars *first_var(Gradient *);
- void resetCG(void);
- friend void CGVars::store_info(Gradient *);
- // void updateDLL(Soma *aSoma);
- };
-
- #endif // __ConjugateGradient_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __Momentum_H__
- #define __Momentum_H__
-
-
- typedef void (*Momentum_MAP)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL, int, BOOL, NSFloat, NSFloat, NSFloat *);
- typedef void (*Momentum_MAP_CSW)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL, int, BOOL, NSFloat, NSFloat, NSFloat *, void *);
-
- class Momentum: public Step {
- protected:
- int momentumCount;
- NSFloat defaultMomentum, *momentumSize, *delta;
- SpatialAccess *deltaWAccess, *momentumAccess;
- BOOL individualMomentums;
- public:
- Momentum();
- void addToMomentum(NSFloat aFloat);
- NSFloat &dW(int i) { return *(delta+i); };
- NSFloat getDefaultMomentum(void) { return defaultMomentum; };
- NSFloat &momentum(int i) { return individualMomentums? *(momentumSize+i): *momentumSize; };
- int momentum(void) { return momentumCount; };
- void multByMomentum(NSFloat aFloat);
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- void setDeltaWAccess(SpatialAccess* anNSAccess);
- virtual void setDefaultMomentum(NSFloat aFloat);
- virtual void setIndividualMomentums(BOOL aFlag);
- virtual void setMomentumAccess(SpatialAccess* anNSAccess);
- // Overwritten virtual functions
- void allocateLinks(int anInt);
- const char *dllFunctionName();
- void networkReset(void);
- void update(Soma *aSoma);
- void updateDLL(Soma *aSoma);
- ~Momentum(void);
- };
-
- #endif // __Momentum_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __Quickprop_H__
- #define __Quickprop_H__
-
-
- typedef void (*Quickprop_MAP)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL, int, BOOL, NSFloat, NSFloat *, NSFloat *, NSFloat, NSFloat *);
- typedef void (*Quickprop_MAP_CSW)(DLLData *, NSFloat *, int, NSFloat *, NSFloat *, BOOL, int, BOOL, NSFloat, NSFloat *, NSFloat *, NSFloat, NSFloat *, void *);
-
- class Quickprop: public Momentum {
- NSFloat *deltaE;
- protected:
- SpatialAccess *deltaEAccess;
- public:
- Quickprop();
- void setDeltaEAccess(SpatialAccess *);
- // Overwritten virtual functions
- void allocateLinks(int anInt);
- NSFloat &dE(int i) { return *(deltaE+i); };
- const char *dllFunctionName();
- void loadStateVariables(FILE *file, unsigned short int version);
- void saveStateVariables(FILE *file);
- void setDefaultMomentum(NSFloat aFloat);
- void update(Soma *aSoma);
- void updateDLL(Soma *aSoma);
- void networkReset(void);
- ~Quickprop(void);
- };
-
- #endif //__Quickprop_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __DeltaBarDelta_H__
- #define __DeltaBarDelta_H__
-
-
- typedef void (*DeltaBarDelta_MAP)(DLLData *, NSFloat *, int, NSFloat, NSFloat *, NSFloat *, NSFloat *, NSFloat, NSFloat, NSFloat);
- typedef void (*DeltaBarDelta_MAP_CSW)(DLLData *, NSFloat *, int, NSFloat, NSFloat *, NSFloat *, NSFloat *, NSFloat, NSFloat, NSFloat, void *);
-
- class DeltaBarDelta: public Quickprop {
- NSFloat kappaValue, betaValue, zetaValue;
- protected:
- NSFloat &D(int i) { return errorSoma->w(i); };
- NSFloat &S(int i) { return dE(i); };
- // Overwritten virtual functions
- public:
- DeltaBarDelta();
- const char *dllFunctionName();
- NSFloat beta() { return betaValue; };
- NSFloat kappa() { return kappaValue; };
- NSFloat zeta() { return zetaValue; };
- void networkReset(void);
- void setDefaultMomentum(NSFloat);
- void setIndividualSteps(BOOL aFlag);
- void setKappa(NSFloat aFloat);
- void setBeta(NSFloat aFloat);
- void setZeta(NSFloat aFloat);
- void update(Soma *aSoma);
- void updateDLL(Soma *aSoma);
- };
-
- #endif // __DeltaBarDelta_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __UnsupervisedFull_H__
- #define __UnsupervisedFull_H__
-
-
- typedef void (*Unsupervised_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat);
- typedef void (*Unsupervised_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat, void *);
-
- class UnsupervisedFull: public FullSynapse {
- protected:
- SpatialAccess *stepAccess;
- BOOL m_bLearning, m_bTempLearning;
- NSFloat step, m_fStep;
- void fireDLL();
- void fireFeed();
- virtual void fireRule();
- virtual void fireRuleDLL();
- SpatialAccess *forcingAccess;
- NSFloat *forcingFeed, *feed;
- BOOL m_bForcing;
- BOOL m_bWeightNormalize;
- BOOL m_bLearningOnReset;
- public:
- UnsupervisedFull();
- const char *dllFunctionName();
- BOOL learning() { return m_bLearning; };
- void networkReset();
- void setLearningOnReset(BOOL aBOOL) { m_bLearningOnReset = aBOOL; };
- void setLearning(BOOL aBOOL) { m_bLearning = aBOOL; };
- void setLearningNO() { m_bTempLearning = m_bLearning; m_bLearning = NO; };
- void setLearningYES() { m_bLearning = m_bTempLearning; m_bTempLearning = NO; };
- void setStepAccess(SpatialAccess *);
- void setStepSize(NSFloat);
- NSFloat stepSize() { return step; };
- void allocateForce(void);
- void allocateSynapticLinks(void);
- void fire(void);
- void setForcing(BOOL);
- void setForcingAccess(SpatialAccess *);
- void setWeightNormalize(BOOL aBOOL) { m_bWeightNormalize = aBOOL; };
- };
-
- #endif // __UnsupervisedFull_H__
-
- // SVMInputSynapse
-
- #ifndef __SVMInputSynapse_H__
- #define __SVMInputSynapse_H__
-
-
- class SVMInputSynapse: public UnsupervisedFull {
- protected:
- BOOL m_bRunningFirstEpoch,
- m_bDotProductMetric;
- int m_nExemplarCount;
-
- public:
- SVMInputSynapse();
- void epochEnded();
- int exemplarCount() { return m_nExemplarCount; };
- void fireFeed(void);
- void fireRule(void);
- void loadStateVariables(FILE *file, unsigned short int version);
- void networkReset();
- BOOL runningFirstEpoch() { return m_bRunningFirstEpoch; };
- void saveStateVariables(FILE *file);
- void setDotProductMetric(BOOL aBool) { m_bDotProductMetric = aBool; };
- void setExemplarCount(int anInt) { m_nExemplarCount = anInt; };
- void setRunningFirstEpoch(BOOL aBool) { m_bRunningFirstEpoch = aBool; };
- };
-
- #endif // __SVMInputSynapse_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __HebbianFull_H__
- #define __HebbianFull_H__
-
-
- class HebbianFull: public UnsupervisedFull {
- protected:
- // SpatialAccess *forcingAccess;
- // NSFloat *forcingFeed, *feed;
- // BOOL m_bForcing;
- public:
- HebbianFull();
- // void allocateForce(void);
- // void allocateSynapticLinks(void);
- // void fire(void);
- void fireRule(void);
- void fireRuleDLL();
- // void HebbianFull::setForcing(BOOL);
- // void setForcingAccess(SpatialAccess *);
- void storeHopfield(int);
- };
-
- #endif // __HebbianFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __OjasFull_H__
- #define __OjasFull_H__
-
-
- class OjasFull: public UnsupervisedFull {
- protected:
- void fireRule(void);
- };
-
- #endif // __OjasFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SangersFull_H__
- #define __SangersFull_H__
-
-
- class SangersFull: public UnsupervisedFull {
- protected:
- void fireRule(void);
- };
-
- #endif // __SangersFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __CompetitiveFull_H__
- #define __CompetitiveFull_H__
-
-
- typedef enum {DotProduct=0, Euclidean=1, BoxCar=2} NMetricType;
- typedef void (*Competitive_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat, int);
- typedef void (*Competitive_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat, int, void *);
-
- class CompetitiveFull: public UnsupervisedFull {
- protected:
- NMetricType m_eMetricType;
- int winningIndex,
- m_nNumSamples;
- SpatialAccess *unifiedDistanceAccess,
- *quantizationMetricAccess;
- NSFloat *m_fpDistanceMatrix;
- NSFloat m_fQuantizationMetric,
- m_fSumError;
-
- public:
- CompetitiveFull();
- NSFloat distance(int r1, int c1, int r2, int c2, NSFloat *input, int koh_cols, int orig_cols);
- const char *dllFunctionName();
- void epochEnded();
- void fireDLL();
- void fireFeed();
- void fireRule();
- virtual void fireWinner();
- virtual void fireWinnerDLL();
- void linksAltered(void);
- void networkReset();
- NMetricType metric() { return m_eMetricType; };
- void setMetric(NMetricType anEnum) { m_eMetricType = anEnum; };
- void setQuantizationMetricAccess(SpatialAccess *anId);
- void setUnifiedDistanceAccess(SpatialAccess *anId);
- };
-
- #endif // __CompetitiveFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __StandardFull_H__
- #define __StandardFull_H__
-
-
- class StandardFull: public CompetitiveFull {
- protected:
- void standardUpdate(int i, int j) { W(i, j) += step * (V(j) - W(i, j)); };
- void fireWinner(void);
- };
-
- #endif // __StandardFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __ConscienceFull_H__
- #define __ConscienceFull_H__
-
-
- class ConscienceFull: public StandardFull {
- protected:
- class SpatialData *frequency, *bias;
- NSFloat m_fBeta, m_fGamma;
- BOOL m_bBiasDataLocal, m_bFrequencyDataLocal;
- public:
- ConscienceFull();
- ~ConscienceFull();
- void allocateSynapticLinks();
- NSFloat beta() { return m_fBeta; };
- void fireRule(void);
- NSFloat gamma() { return m_fGamma; };
- void networkReset();
- void setBeta(NSFloat aFloat) { m_fBeta = aFloat; };
- void setBiasData(SpatialData *);
- void setFrequencyData(SpatialData *);
- void setGamma(NSFloat aFloat) { m_fGamma = aFloat; };
- };
-
- #endif // __ConscienceFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __KohonenFull_H__
- #define __KohonenFull_H__
-
-
- typedef void (*Kohonen_MAP)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat, int, int, int);
- typedef void (*Kohonen_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat *, int, int, NSFloat *, NSFloat, int, int, int, void *);
-
- class KohonenFull: public ConscienceFull {
- protected:
- SpatialAccess *neighborhoodAccess,
- *componentPlaneAccess;
- NSFloat m_fNeighborhood;
- NSFloat *m_fpComponentPlaneMatrix;
- int m_iNeighborhood;
- int startRow, stopRow, m_nComponentPlane,
- startCol, stopCol,
- winningRow, winningCol;
- public:
- KohonenFull();
- int componentPlane();
- const char *dllFunctionName();
- void epochEnded();
- void linksAltered(void);
- int neighborhood() { return (int)m_fNeighborhood; };
- void networkReset();
- void setNeighborhood(int);
- void setNeighborhoodAccess(SpatialAccess *);
- void fireWinner();
- void fireWinnerDLL();
- virtual void fireWinningShape();
- void setComponentPlane(int anInt);
- void setComponentPlaneAccess(SpatialAccess *anId);
- };
-
- #endif // __KohonenFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LineKohonenFull_H__
- #define __LineKohonenFull_H__
-
-
- class LineKohonenFull: public KohonenFull {
- protected:
- void fireWinner();
- };
-
- #endif // __LineKohonenFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __SquareKohonenFull_H__
- #define __SquareKohonenFull_H__
-
-
- class SquareKohonenFull: public KohonenFull {
- protected:
- void fireWinningShape();
- };
-
- #endif __SquareKohonenFull_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __DiamondKohonenFull_H__
- #define __DiamondKohonenFull_H__
-
-
- class DiamondKohonenFull: public KohonenFull {
- protected:
- void fireWinningShape();
- };
-
- #endif __DiamondKohonenFull_H__
-
- // Author: Wesley Curtis Lefebvre
- // Name: Transmitter.h
-
- #ifndef __Transmitter_H__
- #define __Transmitter_H__
-
-
- typedef BOOL (*Transmitter_MAP)(DLLData *, NSFloat *, int);
- typedef BOOL (*Transmitter_MAP_CSW)(DLLData *, NSFloat *, int, void *);
- typedef void (*TransmitterSend_FUNCTION)(void *, const char *);
-
- class Transmitter: public SpatialData
- {
- protected:
- DLLStruct *dllStruct;
- void *m_pSendFunction;
- void *m_pCallingObject;
- unsigned int receiverCount;
- char *receiverName[128];
- void *receiverID[128];
- public:
- Transmitter();
- ~Transmitter();
- void addReceiver(void *anId, const char *);
- virtual void constructDLL(void);
- virtual void destroyDLL(DLLData *);
- virtual void initializeDLL(void);
- void reportSpatialData();
- virtual void sendTransmitterActions();
- virtual void setDLLFunction(DLLStruct *);
- virtual void setDLL(void *function, void *constructor=NULL, void *destructor=NULL, void *instance=NULL, void *callingObject=NULL);
- void setSendFunction(void *aFunction);
- virtual BOOL shouldTransmit(NSFloat *someData);
- virtual BOOL shouldTransmitDLL(NSFloat *someData);
- };
-
- #endif __Transmitter_H__
-
- // Author: Wesley Curtis Lefebvre
- // Name: ThresholdTransmitter.h
-
- #ifndef __ThresholdTransmitter_H__
- #define __ThresholdTransmitter_H__
-
-
- typedef DLLData *(*ThresholdTransmitter_Constructor)(DLLData *, int, int);
- typedef DLLData *(*ThresholdTransmitter_Constructor_CSW)(DLLData *, int, int, void *);
- typedef BOOL (*ThresholdTransmitter_MAP)(DLLData *, NSFloat *, int, int, NSFloat, BOOL, int, int);
- typedef BOOL (*ThresholdTransmitter_MAP_CSW)(DLLData *, NSFloat *, int, int, NSFloat, BOOL, int, int, void *);
-
- class ThresholdTransmitter: public Transmitter
- {
- protected:
- class SpatialAccess *m_thresholdAccess;
- class SpatialData *m_pSmooth;
- NSFloat m_threshold,
- m_thresholdDecay,
- m_fBeta,
- m_fInitialValue,
- m_startingThreshold;
- int m_sendAfter, m_sendAfterCounter, m_thresholdType, m_nChannelNumber;
- BOOL m_bSmoothingDataLocal, m_lessThan, m_bMultBy, m_bAbs;
- public:
- ThresholdTransmitter();
- ~ThresholdTransmitter();
- NSFloat absolute(NSFloat &aFloat) { return m_bAbs? (NSFloat)fabs(aFloat): aFloat; };
- BOOL absoluteValue() { return m_bAbs; };
- BOOL allLessThan(NSFloat *data,int length);
- BOOL averageLessThan(NSFloat *data,int length);
- NSFloat beta(){return m_fBeta;};
- void constructDLL();
- NSFloat initialValue(){return m_fInitialValue;};
- BOOL lessThan(){return m_lessThan;};
- BOOL multBy(){return m_bMultBy;};
- void networkReset();
- BOOL oneLessThan(NSFloat *data,int length);
- BOOL overThreshold(NSFloat *someData);
- int sendAfter(){return m_sendAfter;};
- void sendTransmitterActions();
- void setAbsoluteValue(BOOL aBOOL) { m_bAbs = aBOOL; };
- void setBeta(NSFloat aFloat) { m_fBeta = aFloat; };
- void setChannelNumber(int anInt);
- void setInitialValue(NSFloat aFloat);
- void setData(NSFloat *aFloat, int rows, int cols=1);
- void setSpatialDimension(int, int);
- void setLessThan(BOOL aFlag);
- void setMultBy(BOOL aFlag);
- void setSendAfter(int anInt);
- void setSmoothingData(SpatialData *);
- void setThreshold(NSFloat aFloat);
- void setThresholdDecay(NSFloat aFloat);
- void setThresholdType(int anInt);
- void setThresholdAccess(SpatialAccess *);
- BOOL shouldTransmit(NSFloat *);
- BOOL shouldTransmitDLL(NSFloat *);
- NSFloat threshold(){return m_startingThreshold;};
- NSFloat thresholdDecay(){return m_thresholdDecay;};
- int thresholdType(){return m_thresholdType;};
- virtual NSFloat *weightedAverage(NSFloat *);
- };
- #endif
-
- // Author: Wesley Curtis Lefebvre
- // Name: DeltaTransmitter.h
-
- #ifndef __DeltaTransmitter_H__
- #define __DeltaTransmitter_H__
-
-
- class DeltaTransmitter: public ThresholdTransmitter
- {
- protected:
- NSFloat *m_lastData, *m_deltaData;
- public:
-
- DeltaTransmitter();
- ~DeltaTransmitter();
- DeltaTransmitter *allocateLastData();
- NSFloat *weightedAverage(NSFloat *);
- void setData(NSFloat *, int, int cols=1);
- void setSpatialDimension(int, int);
-
- };
-
- #endif __DeltaTransmitter_H__
-
- #ifndef __Scheduler_H__
- #define __Scheduler_H__
-
-
- typedef DLLData *(*Scheduler_Constructor)(DLLData *, int);
- typedef DLLData *(*Scheduler_Constructor_CSW)(DLLData *, int, void *);
- typedef void (*Scheduler_MAP)(DLLData *, NSFloat *, int, NSFloat);
- typedef void (*Scheduler_MAP_CSW)(DLLData *, NSFloat *, int, NSFloat, void *);
-
- class Scheduler : public SpatialData
- {
- protected:
- NSFloat m_fBeta, m_fMin, m_fMax;
- int m_iStart, m_iStop;
- DLLStruct *dllStruct;
- void *m_pCallingObject;
- public:
- Scheduler();
- virtual void applyDLL();
- virtual void applySchedule(){};
- void attachTo(SpatialAccess *);
- NSFloat beta() { return m_fBeta; };
- void constrain(NSFloat &f) { if (f>m_fMax) f=m_fMax; else if (f<m_fMin) f=m_fMin; };
- const char *dllFunctionName();
- void epochEnded(int);
- void constructDLL();
- void destroyDLL(DLLData *);
- void initializeDLL();
- NSFloat maximum() { return m_fMax; };
- NSFloat minimum() { return m_fMin; };
- void setBeta(NSFloat aFloat) { m_fBeta = aFloat; };
- void setData(NSFloat *, int, int);
- void setDLL(void *function, void *constructor=NULL, void *destructor=NULL, void *instance=NULL, void *callingObject=NULL);
- void setMaximum(NSFloat aFloat) { m_fMax = aFloat; };
- void setMinimum(NSFloat aFloat) { m_fMin = aFloat; };
- void setSpatialDimension(int, int);
- void setStart(int anInt) { m_iStart = anInt; };
- void setStop(int anInt) { m_iStop = anInt; };
- int start() { return m_iStart; };
- int stop() { return m_iStop; };
- };
-
- #endif __Scheduler_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __ExpScheduler_H__
- #define __ExpScheduler_H__
-
-
- class ExpScheduler : public Scheduler
- {
- public:
- ExpScheduler();
- void applySchedule();
- };
-
- #endif __ExpScheduler_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LogScheduler_H__
- #define __LogScheduler_H__
-
-
- class LogScheduler : public Scheduler
- {
- public:
- LogScheduler();
- void applySchedule();
- };
-
- #endif __LogScheduler_H__
-
- // Author: Wesley Curtis Lefebvre
-
- #ifndef __LinearScheduler_H__
- #define __LinearScheduler_H__
-
-
- class LinearScheduler : public Scheduler
- {
- public:
- LinearScheduler();
- void applySchedule();
- };
-
- #endif __LinearScheduler_H__
-